<template>
    <div class="item-content  bg-img" >
        <div class="item-title bg-img">
            <span>今日用电</span>
        </div>
        <div class="main">
            <div class="elect-title-container">
                <div class="nav left flex-column flex-center bg-img">
                    <div class="title">今日用电（度）</div>
                    <div class="text">2498</div>
                </div>
                <div class="nav right flex-column flex-center bg-img">
                    <div class="title">当前功耗（KW）</div>
                    <div class="text">24</div>
                </div>
            </div>
            <el-carousel height="100%" autoplay class="carousel" indicator-position="none" >
                <el-carousel-item>
                    <ElectricEchart class="echart-nav"></ElectricEchart>
                </el-carousel-item>
                <el-carousel-item>
                    <ElectricEchart class="echart-nav"></ElectricEchart>
                </el-carousel-item>
            </el-carousel>
        </div>
    </div>
</template>

<script setup>
    import {defineAsyncComponent} from "vue";

    const ElectricEchart = defineAsyncComponent(() => import('@/components/echarts/electricEchart.vue'));

</script>

<style scoped lang="scss">

    .main{
        height: calc(100% - 11%);
        .elect-title-container{
            display: flex;
            justify-content: space-evenly;
            align-items: center;
            margin: 4px 0;
            min-height: 40px;
            .nav{
                background: linear-gradient(to right, rgba(18, 72, 106, 0.6784313725), rgb(20 118 197 / 93%));
                transform: skewX(353deg);
                border-radius: 4px;
                padding: 4px;
                font-size: 13px;
                flex: 0.4;
            }
        }
        .carousel{
            height: calc(100% - 44px) !important;
        }
        .echart-nav{
            height: 100%;
        }
    }

    .item-content::before{
        border-left: 2px solid #4fd5e1;
        position: absolute;
        width: 8px;
        height: 8px;
        opacity: 1;
        content: "";
        border-top: 2px solid #4fd5e1;
        top: 0px;
        border-radius: 2px;
        left: 0px;
    }
    .item-content::after{
        position: absolute;
        width: 8px;
        height: 8px;
        opacity: 1;
        content: "";
        border-bottom: 2px solid #4fd5e1;
        bottom: -1px;
        border-radius: 2px;
        border-right: 2px solid #4fd5e1;
        right: 0px;
    }
    .item-content{
        position: relative;
        border-radius: 4px;
        background-color: rgb(40 57 111 / 47%);
        margin-bottom: 2%;
        height: 33%;
        color:#fff;
        .item-title{
            display: flex;
            align-items: center;
            font-size: 18px;
            background-image: url("@/assets/imgs/31.png");
            height: 11%;
            padding-left: 10%;
            span{
                background: linear-gradient(to bottom, #fff, #055eff);
                color: transparent;
                background-clip: text;
                font-weight: bold;
            }
        }
    }

</style>